
#ifdef CONFIG_MMC_TESTER

#ifndef  __MMC_TESTER_H__
#define  __MMC_TESTER_H__

#ifdef _cplusplus
extern "c"{
#endif

#include "Mmc.h"
#include "IicDriverTester.h"

typedef struct _MmcStartTestData
{
	uint8 m_DelayS;
	uint8 m_TimeOutCount;
}MmcStartTestData;


typedef struct _SensorTestData
{
	uint8 m_SensorId;
	uint8 m_CmValue;
	uint8 m_RawValue;
	uint8 m_Offset;
	uint8 m_Threshold;
	uint32 m_SendReqCount;
}SensorTestData;

struct _MmcTester;
typedef Bool (*VerifyFun)(struct _MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
typedef struct _MmcTester
{
	Mmc* m_pMmc;
	
	Bool 		m_bVerifyResult;
	uint8 		m_bCrbState;
	
	Queue			m_MmcToCmQueue;
	BusDataPacket	m_MmcToCmQueueBuff[MAX_BUS_DATAPACKET];

	Queue			m_CmToMmcQueue;
	BusDataPacket	m_CmToMmcQueueBuff[MAX_BUS_DATAPACKET];
	
	IicDriver		m_IicDriver;
	
	Queue			m_MmcToPayloadQueue;
	BusDataPacket	m_MmcToPayloadQueueBuff[MAX_BUS_DATAPACKET];

	Queue			m_PayloadToMmcQueue;
	BusDataPacket	m_PayloadToMmcQueueBuff[MAX_BUS_DATAPACKET];
	IicDriver		m_UartDriver;
	
	
	BusDataPacket 	m_ReqPacket;
	//IicCmd			m_IicCmd;
	const IpmiCmdHandler*	m_pCmdHandlerTable;
	uint8					m_Count;
}MmcTester;

Bool MmcTester_Start(Mmc* pMmc, uint32 input[], uint32 output[]);
void MmcTester_Init(MmcTester* pMmcTester, Mmc* pMmc);
void MmcTest_Reset(MmcTester* pMmcTester);
Bool MmcTester_Start_ConfigOk(Mmc* pMmc, MmcStartTestData* pTestData);
Bool MmcTester_Start_ConfigError(Mmc* pMmc, uint8 delayS, uint8 timemoutCount);
Bool MmcTester_Start_FruError(Mmc* pMmc, uint8 delayS, uint8 timemoutCount);
Bool MmcTester_cmd(MmcTester* pMmcTester, ReqData* pReq, VerifyFun verify);
Bool MmcTester_cmdEx(MmcTester* pMmcTester, ReqData* pReq, VerifyFun verify, uint32 input[]);
Bool MmcTester_payloadCmd(MmcTester* pMmcTester, ReqData* pReq, VerifyFun verify);
Bool MmcTester_SetEventReceiver(MmcTester* pMmcTester, ReqData* pReq, VerifyFun verify, uint32 output[]);

Bool MmcTester_VerifyTemp(MmcTester* pMmcTester, SensorTestData* pSensorTestData, EventReqMsg* pEventReqMsg, uint8 Len);
Bool MmcTester_VerifyHotSwap(MmcTester* pMmcTester, SensorTestData* pSensorTestData, EventReqMsg* pEventReqMsg, uint8 Len);
Bool MmcTester_SensorTest(MmcTester* pMmcTester, SensorTestData* pSensorTestData, VerifyFun verify);

Bool MmcTester_Verify(MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetDeviceId(MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifySetEventReceiver(MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetEventReceiver(MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetDeviceSdrInfo(MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetDeviceSdr(MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetSensorReading(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyLampTest(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyReserveDevSdrRepo(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetFruInventory(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyReadFruData(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyWriteFruData(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetPicmgPorperties(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyFruCtrlCap(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetFruLedProper(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifySetLedState(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetLEDColorCap(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetFruLedSte(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetLocatorRecordId(MmcTester* pMmcTester, ReqData* pReqData, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifySetPortState(MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
Bool MmcTester_VerifyGetPortState(MmcTester* pMmcTester, ReqData* pReq, uint8* pRspData, uint8 rspLen);
#ifdef _cplusplus
}
#endif

#endif 

#endif	//#ifdef CONFIG_MMC_TESTER

